import { createApp, useAttrs } from "vue";
import ElementPlus from "element-plus";
import "./style/index.css";
import "./style/bjBuilding/reuse.css";
import "./style/bjBuilding/com.less";
import "element-plus/dist/index.css";
import 'vue-cesium/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import locale from "element-plus/es/locale/lang/zh-cn"
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import router from "./router/index";
import App from "./App.vue";
import * as echarts from "echarts";
import { createPinia } from "pinia";
import VueCesium from 'vue-cesium';
import DataVVue3 from '@kjgl77/datav-vue3';
let app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
import axios from "./utils/request";
//跳转开发商详情
function goDetail(groupName: any) {
  router.push({ name: "detail", params: { groupName: groupName } });
}

//跳转项目详情
function goProDetail(borrowXmId: any, xmName: any) {
  router.push({ name: "proDetail", params: { borrowXmId: borrowXmId, xmName: xmName } });
}

app.directive('focus', {
  mounted(el) {
    console.log(el)
    // el为指令绑定的页面元素
    el.style.color = 'red';
  }
})


app.config.globalProperties.$goDetail = goDetail;
app.config.globalProperties.$goProDetail = goProDetail;
app.config.globalProperties.$http = axios;
app.provide("echarts", echarts);
const pinia = createPinia();
app.use(ElementPlus, { locale: zhCn }).use(pinia).use(router).use(VueCesium).use(DataVVue3).mount("#app");